Guild icon
PLU CSCI 390 Group
Text Channels / model-design-shiz
Avatar
I played around with creating a very rough draft class diagram (top) as well as updating the domain model a little. I want some feedback before I commit to anything official. I'm still struggling with what Wolff put in feedback about abstracting the puzzle object and how to represent puzzles in progress. Currently, I'm thinking that puzzle progress will be stored per user as a Level type object? Essentially storing their board state? It doesn't feel quite right. Other than that, actually representing the board is kinda being weird to me. I think its helpful conceptually to think about the Board being made up of several cells, but on a practical level, its much easier to have the Board be a simple 2D array, with the cells just being X, Y pairs in that array, which is what I have tried to model in the class diagram.
Avatar
Implementation focused time! I tried my best to follow along with the Jackson packages for reading in JSON files, since it seems someone (probably Eric) already set that up within our packages. To that end, there is a new Puzzle Class that reads in the data from the PuzzleDTO. However, for ease, I am still using the CellDTO to represent an actual Cell object. They are functionally the same, so it may be worth just changing the name of CellDTO to Cell. (and thus retiring the Cell class that I made in testing)
22:28
On the Cell Class, I added a method that cycles the type. The type is a simple String that has 3 states (from the user perspective): EMPTY, STAR and MARKER. The changeType() method takes a boolean that is standing in for a left vs right click action. On left click, it cycles to the next type. On right click, it clears, setting the cell to empty.
Avatar
On the Puzzle Class, it loads in all the data from a PuzzleDTO (regions, gridSize, etc) allowing for easy conversion from JSON to a usable object. It also has a 2D Cell array board, separate from regions. This is to easily check spatially related cells, such as rows, columns or adjacent. Speaking of which, there is now a checkBoard method that should likely be called whenever a change is made to the board. It checks the rows and columns, seeing if there are multiple stars in that row or not. It takes a boolean input visible that tells the program whether it should auto-generate markers (thus they are visible on the board). It also checks adjacent spaces to any cells with stars. It automatically detects whether a placement is valid, by setting stars that are too many to "INVALID" type. Auto-generated markers are set to type "VMARKER", so that they can be differentiated from player-placed markers. Auto-generated markers are automatically removed when calling checkBoard(false). I'm realizing that these extra types may not work with the cycling method of cell, so I may have to adjust that at a later time.
22:37
There is a domainTest class that demos a lot of this, and included in Puzzle is a helpful printBoard method that has a text representation of the board with each cell's type
Avatar
Updated the domain model and class diagram to reflect new code. These are also in the Drive
19:02
(edited)
19:02
πŸ”₯ 1
Avatar
Awesome, thanks so much Brandon! Ill take a look at the code you pushed at somepoint. I still trying to get over this cold 😭
Avatar
No worries, take your time for recovery (just like I had to πŸ˜‰ ). For all, feedback is welcomed when you get the chance.
Avatar
Yeah today was super busy for me I’ve been running around Tennessee today so most likely tomorrow and this weekend will working on everything
πŸ‘ 1
Avatar
I still need to fix the choose puzzle UI so it has pages etc
Avatar
Reworked pretty much all of the code I wrote on Wednesday. Same basic ideas apply, but my boardCheck method now only checks single row and column of cells with stars in them rather than the whole board. Also implemented the region check and tacked it onto the end of the boardCheck
Avatar
@Eric Golde Moving back into this chat. Have you made it so onClick calls the changeType method? That was my initial intention with that method and without it, I'm not sure what the domainTest will do.
Avatar
Avatar
Brandon
@Eric Golde Moving back into this chat. Have you made it so onClick calls the changeType method? That was my initial intention with that method and without it, I'm not sure what the domainTest will do.
Yes, i just renamed the method, and inverted your if statement
19:49
so with splitting everything, I will split the drawing code out of the Cell, and out of the Puzzle class, into like PuzzleComponent and CellComponent classes. Then we can move them out of the UI class if needed
Avatar
Oh sorry, this was confusing code on my part. It needs to call the PuzzleClass changeType, which is supposed to remotely call the Cell class changeType and do clearAdjacent if necessary.
Avatar
i think so but Im not at my pc right now
Avatar
I'm trying to adjust it right now and see if it works.
πŸ‘Œ 1
Avatar
Hey Eric, it looks like the Puzzle in DomainTest is loading in with a bunch of stars pre-placed. Is that an intended implementation thing? Like is it reading in the solution?
20:04
NM, I found where it is, haha
Avatar
oh yeah, for testing I did that
Avatar
@Eric Golde I seem to have found rather an annoying discrepancy that may need to be addressed. All of your board referencing is done [col][row] and all of my board referencing is done [row][col]. I figured out that is why my test is not behaving as expected.
Avatar
Okay getting all those flipped around on my end seems to have fixed any remaining errors. I'm going to push a decent number of changes now, so you may want to pull again @Eric Golde
20:28
I also made it so onClick calls the Puzzle changeType (now onClick), instead of the Cell one
20:28
The Cell on is back to being changeType
Avatar
Avatar
Brandon
@Eric Golde I seem to have found rather an annoying discrepancy that may need to be addressed. All of your board referencing is done [col][row] and all of my board referencing is done [row][col]. I figured out that is why my test is not behaving as expected.
oh... yeah that may cause some issues πŸ˜‚
Avatar
Avatar
Brandon
Okay getting all those flipped around on my end seems to have fixed any remaining errors. I'm going to push a decent number of changes now, so you may want to pull again @Eric Golde
You rock, tysm
20:30
lmk when you have finished pushing everything, ill pull once I get back home
Avatar
Assuming I have done it correctly, it is pushed now
Avatar
awesome, tysm
20:31
ill work on getting the classes split so UI and logic are in different classes (edited)
Avatar
Perfect, sounds good
Avatar
I'm falling asleep at the keyboard. I'll work more on this wednesday
Avatar
Ive merged yours and seths code into master. Ill work on getting things split today into a logic and a drawing class
Avatar
I thought this was interesting, using this work on our package diagram
14:10
Does anyone know if the package diagram includes the server? I'm not sure how granular I would get there?
Avatar
Avatar
Chris
I thought this was interesting, using this work on our package diagram
That’s looks clean and don’t think so for the server
πŸ‘ 1
Avatar
Avatar
Chris
I thought this was interesting, using this work on our package diagram
that looks really good. Was this using that auto generator thing you mentioned?
Avatar
Yes, that was. If you right click on any package on IntelliJ there should be something called Diagrams at the bottom
16:14
This was me generating a diagram for all of our source code
Avatar
oh, intresting
Avatar
But it doesn't have everything as you can see
Avatar
It looks good, not sure if its really divided cleanly into packages at this point. It still kinda feels like they are all floating in nebulous space except for the few that are connected
Avatar
Really, our project is divided into the UI package, the model package, and our server with the database and rest endpoints. (edited)
Avatar
Yeah, I get that, but for example, where is the distinction of the UI from the model in this diagram? Maybe I'm just not seeing it
16:17
Is it level based? Like is each tier representative of something? Maybe that's what I'm missing
Avatar
That would be right. There is no package level organization at the moment. Just shows our classes, and where they inherit from. I highlighted some classes that come from each. Key based off of food colors Outlined by Red (🍎) = UI Outlined by Yellow (🍌 ) = Server Outlined by Green (πŸ₯ ) = Model
Avatar
Oh nice, even that is very helpful. I trust that will turn out well, thanks!
Avatar
Yeah, I'll let you guys know in the next 1-2 hours here. But Brandon, I actually found a way for class diagrams here too. Pretty cool stuff
Avatar
Avatar
Chris
Yeah, I'll let you guys know in the next 1-2 hours here. But Brandon, I actually found a way for class diagrams here too. Pretty cool stuff
I really like that wtf
Avatar
Ok, so currently this is what I got. I don't necessarily know how granular he wants it. I broke it up as such. UI Package: contains screens, popups, and most general webb components (swing-based components tailored to our game) Server: Has the REST controllers, a repository for managing/reading/writing database stuff, and the player manager which is our authentication sub package. Domain: Is broken up into stuff that deals with the players and the puzzle. A couple of things that I realized is that the leaderboard isn't necessarily here. I would assume that would be on the server, but probably should be modelled in a way?
17:33
Dashed lines are depends on, and the bold strong lines are just a messaging scheme
17:33
Excalidraw is a virtual collaborative whiteboard tool that lets you easily sketch diagrams that have a hand-drawn feel to them.
Avatar
@Seth what do you think
Avatar
Avatar
Chris
@Seth what do you think
I think it looks great overall but I’m also confused about the leaderboard if needs to be on here
Avatar
Ok cool, what do y'all think @Brandon and @Eric Golde?
Avatar
I agree, I think the package diagram looks really good
Avatar
Avatar
Chris
Ok cool, what do y'all think @Brandon and @Eric Golde?
i'm not at home atm, and the site isn't wanting to load funny on mobile weirdly
18:06
ill take a look when I am back at a pc
18:06
but I trust yall
Avatar
Cool. Well I am going to turn it in with a description.
Avatar
Turn what in?
Avatar
The package diagram. I am just going to be putting it into the iteration2 folder in docs
19:21
Avatar
Oh okay, I thought you might have meant the whole thing and I didn't quite feel confident in that yet. But yes, the Package Diagram is good πŸ‘
Avatar
Yeah, when we are all ready. I can go ahead and make a tag
Avatar
Perfect, I've started chipping away at the UI class diagrams (see ui-design channel). I think if we do that, get all the diagrams collated, and make sure mine and Eric's combined branch gets pushed to main, we should be pretty much ready to turn in.
Avatar
looks good! I may advoid merging it to main atm. Is there any way we can tag iteration2 as another branch? I mean we can merge it, its just not fully tested
19:49
i finally got the website to load on my phone 😐
Avatar
That is a little out of my sphere of knowledge. I was hoping someone else could handle the tagging. There is probably a way to tag it, I have to imagine.
Avatar
I’m still currently working on the player stats but getting food rn
Avatar
im not sure when ill have my pc back atm, not at home still
Avatar
Sounds good @Seth
Avatar
Avatar
Eric Golde
looks good! I may advoid merging it to main atm. Is there any way we can tag iteration2 as another branch? I mean we can merge it, its just not fully tested
Oh well, I merged my stuff into main. So we’ll need to branch off now and pull from whatever dev branch?
Avatar
its fine dw about it
20:38
I was more talking about the wip code
20:38
but it can also be merged
20:38
its chill
Exported 79 message(s)